<?php
class Lophp extends AppModel {
	var $name = 'Lophp';
	var $validate = array(
		'malophp' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'mon_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'giangvien_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
	);
	//The Associations below have been created with all possible keys, those that are not needed can be removed
	var $actsAs = array('FileUpload.FileUpload' => array(
         				'uploadDir' => 'files',
						'fileModel'=>'Lophp',
          				'forceWebroot' => true, //if false, uploads will be saved to
                                           //the uploadDir as a direct path.
                                           //default: true
          				'fields' => array(
            			'name' => 'file_name',
            			'type' => 'file_type',
            			'size' => 'file_size' ),
	
				          'maxFileSize' => '3000000', //in bytes
				          'unique' => false, //uploaded files will overwrite existing files
				          'fileNameFunction' => 'sha1', //execute sha1 on fileName
        ));

        var $belongsTo = array(
		'Mon' => array(
			'className' => 'Mon',
			'foreignKey' => 'mon_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Giangvien' => array(
			'className' => 'Giangvien',
			'foreignKey' => 'giangvien_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Hknk' => array(
			'className' => 'Hknk',
			'foreignKey' => 'hknk_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);

	var $hasMany = array(
		'Ketqua' => array(
			'className' => 'Ketqua',
			'foreignKey' => 'lophp_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		)
	);

}
